<?php


/**
 * 
 */
class ServiceUserModel extends CommonModel
{
    
   protected $tableName = "hwl_service_user";   //指定表名
   private $pageHtml = '';

   //查询全部方法
   public function getList($page = 1) {
         $bind = $this->query->from($this->tableName)->orderby('sort','DESC')->orderby('id','DESC');
         if($page === false) {
         return $bind->getall();
   }
        $page = (int)$page;
        //var_dump($bind);
        $total = $this->query->from($this->tableName)->getcolumn('count(*)');
        var_dump($total);
        $pageIndex = $page;

        $pageSize = 10;

        $this->pageHtml = pagination($total,$pageIndex,$pageSize);

        return $bind->page($pageIndex,$pageSize)->getall();

}
 // inc中调用的方法，初始化分页html。
 public function lastPageHtml() {
        $html = $this->pageHtml;
        $this->pageHtml = '';
        return $html;
    }
}